package com.example.test;

public class Two_HasStatic {
    private static int x =100;
    public static void main(String[] args) {
        int y =100;
        y++;
        System.out.println(y); //101
        ++y;
        System.out.println(y); //102
        System.out.println(y++);//102
        System.out.println(++y);//104
        System.out.println();

        Two_HasStatic hs1 = new Two_HasStatic();
        hs1.x++;
        System.out.println(Two_HasStatic.x);//101 打印hs1 为地址值
        Two_HasStatic hs2 = new Two_HasStatic();
        hs2.x++;
        System.out.println(Two_HasStatic.x);//103
        hs1 = new Two_HasStatic();
        hs1.x++;
        System.out.println(Two_HasStatic.x);//103
        Two_HasStatic.x--;
        System.out.println(Two_HasStatic.x);//102

    }
}
